package com.mall.client.server.controller;

import com.mall.client.server.domain.Coupon;
import com.mall.client.server.service.CouponsService;
import com.mall.common.core.domain.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName CouponController
 * @Description 描述
 * @Author Qiu Feng
 * @Date 2025/2/17 16:05
 */
@RestController
@RequestMapping("/coupons")
public class CouponsController {
    @Autowired
    private CouponsService couponService;
    /**
     * 优惠券列表
     * @return
     */
    @GetMapping("/list")
    public Result couponList() {
        List<Coupon> coupons = couponService.couponList();
        Result<List<Coupon>> success = Result.success(coupons);
        return success;
    }
}
